import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import vueSetupExtend from 'vite-plugin-vue-setup-extend'
const path = require('path')

// https://vitejs.dev/config/
export default defineConfig({
  plugins: [vue(), vueSetupExtend()],
  base: './',
  css: {
    preprocessorOptions: {
      less: {
        additionalData: `
          @import "@/assets/styles/variables.less";
          @import "@/assets/styles/mixins.less";
        `
      }
    }
  },
  resolve: {
    alias: {
      '@': path.resolve(__dirname, './src')
    }
  },
  //  vue-cli devServer   vite:server
  server: {
    open: true,
    host: 'www.corho.com',
    port: 8080
  }
})

/*
vue-cli
  1:.env.production  生产环境变量调整
  2:vue.config.js   publicPath:'./'
  3:执行  npm run build

vite
  1:.env.production  生产环境变量调整
  2:vue.config.js   base:'./'
  3:执行  npm run build

*/
